<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2025/8/29
  Time: 16:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript">

      $(document).ready(function () {


        //发送异步，获得全部数据
        $("[id='login']").click(function () {

          var user=$("[name='user']").val();
          var psd=$("[name='psd']").val();

          $.get("login/showdt",{"user":user,"psd":psd},function (users){
            JSON.stringify(users)
            if (users){
              window.location.href="book.jsp?user="+user;
            }else {
              alert("登录失败")
            }
          });
        })


      });

    </script>
  </head>
  <body>
     <table>
       <caption>图书借阅系统</caption>
       <tr>
         <td>
           登录账号：
           <input type="text" name="user"/>
         </td>
       </tr>
       <tr>
         <td>
           登录密码：
           <input type="password" name="psd"/>
         </td>
       </tr>
     </table>
     <input type="button" value="登录" id="login">
     <input type="button" value="注册">
  </body>
</html>
